﻿<%--This file is part of ILoveHUSTBoard.

ILoveHUSTBoard is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ILoveHUSTBoard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ILoveHUSTBoard.  If not, see <http://www.gnu.org/licenses/>.--%>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="WebSite.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0036)http://www.hustonline.net/index.aspx -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="keywords" content="留言板，华中科技大学,华中大在线,冰岩作坊,校园门户,HUST,大学生,教育网" />
<meta name="description" content="I love HUST - 说说你和HUST的事儿" />
<meta name="author" content="冰岩作坊" />
<title>Ilovehust - 说说你和HUST的事儿</title>
<link rel="Stylesheet" type="text/css" href="css/layout.css" />
<link rel="Stylesheet" type="text/css" href="css/extra.css" />
<link rel="Stylesheet" type="text/css" href="css/reset.css" />
<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="js/wall.js" type="text/javascript"></script>
<script src="js/share_to.js" type="text/javascript"></script>
<%if (Request["error"] != null)
  { %>
<script type="text/javascript">
<%string error=Request["error"]; %>
<%if(error=="login"){ %>
alert("请登录后使用，亲～");
<%} %>
<%if(error=="hexie"){ %>
alert("为了世界的和平，请使用文明用语，亲～");
<%} %>
<%if(error=="unknown"){ %>
alert("Oops, 发生了个奇怪的错误");
<%} %>
<%if(error=="loginerror"){ %>
alert("登录失败，你确定输入了正确的用户名和密码？");
<%} %>
</script>
<%} %>

<script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-23985187-1']);
    _gaq.push(['_trackPageview']);

    (function () {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

</script>
</head>
<%bool isLoggedIn = Session["login"] != null; %>
<%
    int pageIndex=1;
    int pageItemCount=10;
   %>
<%try 
  { 
      if(Request["page"]!=null)
          pageIndex = Convert.ToInt32(Request["page"]);
      pageItemCount=Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["page_item_count"]);
  }
  catch { pageIndex = 1; } %>
<body style="background:url(image/body_bj.gif);">
<!--[if lte IE 6]>
<div id="ie6-warning">您正在使用 Internet Explorer 6（或是使用IE6核心的浏览器）。为了您的浏览体验，建议您升级到 <a href="http://www.microsoft.com/china/windows/internet-explorer/" target="_blank">Internet Explorer 9</a> 或以下浏览器： <a href="http://www.mozillaonline.com/">Firefox</a> / <a href="http://www.google.com/chrome/?hl=zh-CN">Chrome</a> / <a href="http://www.apple.com.cn/safari/">Safari</a> / <a href="http://www.operachina.com/">Opera</a>
</div>
<style type="text/css">
       #ie6-warning{
       background:rgb(255,255,225) url("http://ued.taobao.com/images/warning.gif") no-repeat scroll 3px center;
       position:absolute;
       top:0;
       left:0;
       font-size:12px;
       color:#333;
       width:97%;
       padding: 2px 15px 2px 23px;
       text-align:left;
       z-index:10000;
}
#ie6-warning a {
       text-decoration:none;
}
</style>
<script type="text/javascript">
function position_fixed(el, eltop, elleft){  
       // check if this is IE6  
       if(!window.XMLHttpRequest)  
              window.onscroll = function(){  
                     el.style.top = (document.documentElement.scrollTop + eltop)+"px";  
                     el.style.left = (document.documentElement.scrollLeft + elleft)+"px";  
       }  
       else el.style.position = "fixed";  
}
       position_fixed(document.getElementById("ie6-warning"),0, 0);
</script>
<![endif]-->
	<div id="wrapper">
		<div id="container">

			<h2>说说你与HUST的事---留言墙
                  <a class="home" title="返回首页" href="index.aspx" target="_self"></a>
				  <a class="ho_logo" href="http://www.hustonline.net" title="返回华中大在线"></a>
                  <div class="today clearfix"><!--这里要换，整个div-->
			      <img  src="image/today.png" alt="今日主题"/>
				  <strong class="today_t">“说说你做过最SB的事”</strong>
				  <input type="submit" class="myword" value="" name="myword" title="感慨几句吧"/>
                  </div>
			</h2>
					
					<div class="loginbox" style="display:none;">
						<img class="close" src="image/close.png" alt="close"/>
						<form action="actions/login.aspx" method="post">
						<span class="nickname">用户名</span>
						<input type="text" class="n_input"  name="username" value="" size="18" maxlength="36" tabindex="1" />
						<span class="password">密码</span>
						<input type="password" class="p_input"  name="password" value="" size="18" maxlength="36" tabindex="1" />
						<a href="http://www.hustonline.net/user/" target="_blank" class="register">我要注册</a>
                        <input type="hidden" name="returnUrl" value="/index.aspx?page=<%=pageIndex%>" />
						<input type="submit" class="login" value="" name="login" title=""/>

						</form>
					</div>			
			<div id="content" class="clearfix">
				<div class="leftside">

                <form id="messageform" style="display:none;" action="actions/add_message.aspx" method="post">
						<div class="reply" style="width:566px;">
							<%if (!isLoggedIn)
         { %><a href="javascript:void(0);" class="remind_l tologin">用Hustonline帐号登录</a><a href="http://www.hustonline.net/user/" target="_blank" class="remind_r">新用户注册</a><%} %>
                            <%else
         { %><span class="remind_loggedin">Hi, <%:Session["login"]%>!</span><%} %>
							<span class="text">我想说</span>
							<textarea  class="t_textarea" tabindex="1" accesskey="1" name="message"></textarea>
							<input type="submit" class="publish" value="" name="publish" title=""/>
						</div>
					</form>
                    <ul>

                <%DataHandler.message.MessageProcessor messageProcessor = new DataHandler.message.MessageProcessor(); %>
                <%DataHandler.reply.ReplyProcessor replyProcessor=new DataHandler.reply.ReplyProcessor(); %>
                <%DataHandler.message.LoveProcessor loveProcessor=new DataHandler.message.LoveProcessor(); %>
                <%var messageList = messageProcessor.GetMessages(pageIndex,pageItemCount); %>
                <%if (messageList != null)
                  {
                      int backgroundIndicator = 1;
                      foreach (var message in messageList)
                      { %>
					<li<%if(backgroundIndicator%2==0){ %> class="withbj"<%} %>>
						<input type="hidden" value="<%:message.Id %>" name="messageid" />
						<img src="image/star.gif" alt="星星"/>
						<strong><%:message.NickName%></strong>
						<span><%=message.Message%></span>
                        <%var replyList = replyProcessor.GetReplies(message.Id); %>
						<p>
							<a href="javascript:void(0);" class="toreply" title="留句话吧">回应[<span class="replycount"><%:replyList == null ? 0 : replyList.Count%></span>]</a> <a href="javascript:void(0);" title="喜欢" class="tolove">赞[<span class="lovecount"><%:loveProcessor.GetLoveCount(message.Id)%></span>]</a><a href="javascript:void(0);" title="告诉你的朋友吧" class="share">分享</a>
						</p>
                        <div class="share_div">
							<img src="image/icon_1.jpg" onclick="shareTo('renren');" />
							<img src="image/icon_2.jpg" onclick="shareTo('douban');" />
							<img src="image/icon_3.jpg" onclick="shareTo('qzone');" />
							<img src="image/icon_4.jpg" onclick="shareTo('tqq');" />
							<img src="image/icon_5.jpg" onclick="shareTo('kaixin');" />
							<img src="image/icon_6.jpg" onclick="shareTo('tsina');" />
                            <div class="clearfix"></div>
						</div>

                        <%if (replyList != null)
                          {
                              foreach (var reply in replyList)
                              { %>
						<div class="message" style="display:none;">
							<strong><%:reply.NickName%></strong>
							<span><%=reply.Content%></span>
						</div>
                        <%}
                          } %>
						<form action="" class="replyform" style="display:none;">
						<div class="reply">
							<%if (!isLoggedIn)
         { %><a href="javascript:void(0);" class="remind_l tologin">用Hustonline帐号登录</a><a href="http://www.hustonline.net/user/" target="_blank" class="remind_r">新用户注册</a><%} %>
         <%else
         { %><span class="remind_loggedin">Hi, <%:Session["login"]%>!</span><%} %>
							<span class="text">我想说</span>
							<textarea class="t_textarea" tabindex="1" accesskey="1" name="message"></textarea>
							<input type="submit" class="publish tosubmitreply" value="" name="publish" title=""/>
						</div>
						</form>
					</li>
                    <%
                          backgroundIndicator++;
                        }
                  }%>
				</ul>
                </div>
				<ul class="rightside">
                <%var topTen = messageProcessor.GetTopTenLovedMessage(); %>
                <%int messageIndex = 1; %>
                <%if (topTen != null)
                  {
                      DataHandler.TMessage message;
                      for(int i=0;i<topTen.Count;i++)
                      {
                          //去除<br />
                          topTen[i].Message = topTen[i].Message.Replace("<br/>", "");
                          message = topTen[i];
                          %>
                <%switch (messageIndex)
                  { %>
                <%case 1: %>
                <li><strong style="background:#FF500C;padding:2px 4px;color:#fff;margin-right:6px;">1</strong><a href="single.aspx?id=<%:message.Id%>"><%:message.Message.Length > 20 ? message.Message.Substring(0, 20) + "..." : message.Message%></a></li>
                <%break;
                  case 2: %>
					<li style="opacity:.8;"><strong style="background:#FFAD09;padding:2px 4px;color:#fff;margin-right:6px;">2</strong><a href="single.aspx?id=<%:message.Id%>"><%:message.Message.Length > 20 ? message.Message.Substring(0, 20) + "..." : message.Message%></a></li>
                <%break;
                  case 3: %>
					<li style="opacity:.6;"><strong style="background:#EEE93A;padding:2px 4px;color:#fff;margin-right:6px;">3</strong><a href="single.aspx?id=<%:message.Id%>"><%:message.Message.Length > 20 ? message.Message.Substring(0, 20) + "..." : message.Message%></a></li>
                <%break;
                  default: %>
					<li style="opacity:.4;"><strong style="background:#999999;padding:2px 4px;color:#fff;margin-right:6px;"><%:messageIndex%></strong><a href="single.aspx?id=<%:message.Id%>"><%:message.Message.Length > 20 ? message.Message.Substring(0, 20) + "..." : message.Message%></a></li>
                <%break;
                  }%>
                <%messageIndex++;
                      }
                  }%>
				</ul>
                <div class="clearfix"> </div>
				<p class="page_reverse">
                <%DataHandler.message.PageProcessor pageProcessor = new DataHandler.message.PageProcessor(); %>
                <%=pageProcessor.GetPageString(pageIndex,pageItemCount) %>
					<%--<a href="#"><<</a><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">4</a><a href="#">5</a><a href="#">6</a><a href="#">...</a><a href="#">>></a>--%>
				</p>
			</div>
		</div>
		<div id="footer">© Hustonline.net,版权所有 鄂ICP备05011690号 Powered by  <a target="_blank" style="color: rgb(255, 102, 0);" href="http://www.bingyan.net/">
                <img alt="冰岩作坊" src="image/bt_logo.gif" /> 冰岩作坊</a>
                <br />
        本站在GPLv3协议下开放<a style="color:#599DAA;font-weight:bolder" href="http://code.google.com/p/i-love-hust-board/">源代码</a>
		</div>
		<a class="top fixed_bottom" href="#" title="" style="display:none;"><img src="image/top.gif" alt="返回顶部" /></a>
		<img src="http://pageview.hustonline.net/addcount.aspx?id=12" style="visibility:hidden"/>
	</div>
</body>
</html>

